]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Panel: move the _panelContainer down to PanelMenu
authorGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 4 Sep 2012 16:27:50 +0000 (18:27 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 4 Sep 2012 21:52:41 +0000 (23:52 +0200)
Panel already forces each item to be a PanelMenu.Button, so it's better
to have the latter handle the bin container too, instead of attaching
a private property that might collide with internal usage by the indicator.

https://bugzilla.gnome.org/show_bug.cgi?id=683156

js/ui/panel.js
js/ui/panelMenu.js

index 2e14c2277e2b04fabc91c9edca47b7507d7a0ff4..a92b810fb88a5710db26ccb01adf778baf974cf4 100644 (file)
@@ -1174,7 +1174,7 @@ const Panel = new Lang.Class({
             let indicator = this.statusArea[role];
             if (!indicator)
                 continue;
-            indicator._panelContainer.hide();
+            indicator.container.hide();
         }
     },
 
@@ -1206,18 +1206,12 @@ const Panel = new Lang.Class({
     },
 
     _addToPanelBox: function(role, indicator, position, box) {
-        let container = indicator._panelContainer;
-        if (!container) {
-            container = new St.Bin({ y_fill: true,
-                                     child: indicator.actor });
-            indicator._panelContainer = container;
-        }
+        let container = indicator.container;
         container.show();
 
         let parent = container.get_parent();
-        if (parent) {
+        if (parent)
             parent.remove_actor(container);
-        }
 
         box.insert_child_at_index(container, position);
         if (indicator.menu)
index 1cad7c89430730389f1f7343645177bd7c44caf6..a20c5fc21eb3e61239fa251a81f65902025c31d3 100644 (file)
@@ -21,6 +21,10 @@ const ButtonBox = new Lang.Class({
         this.actor = new Shell.GenericContainer(params);
         this.actor._delegate = this;
 
+        this.container = new St.Bin({ y_fill: true,
+                                      x_fill: true,
+                                      child: this.actor });
+
         this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
         this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
         this.actor.connect('allocate', Lang.bind(this, this._allocate));